<?php

class CNotFoundException extends Exception {
	private $Container;

	public function container() {
		return $this->Container;
	}

	protected function setContainer($newValue) {
		$this->Container = $newValue;
		return $this;
	}

	private $Identifier;

	public function identifier() {
		return $this->Identifier;
	}

	protected function setIdentifier($newValue) {
		$this->Identifier = $newValue;
		return $this;
	}

	function __construct($container, $identifier = null, $message = null) {
		$identifierStr = is_null($identifier)? "<this request>" : $identifier;
		$containerStr = method_exists($container, '__toString')? $container->__toString() : get_class($container);
		CDefault($message, "Container $containerStr has no content for $identifierStr");
		parent::__construct($message);
		$this
			->setContainer($container)
			->setIdentifier($identifier);
	}
}

?>